/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package demo903;

import java.util.Arrays;

/**
 *
 * @author Administrator
 */
public class ArrayDemo1 {

    public static void main(String args[]) {

        int b[] = {1, 20, 3, 4, 5};
        int max = b[0];
        int min = b[0];

//      for(int i=1;i<5;i++){
//          if(max<b[i])max=b[i];
//      }
//      for(int i=1;i<5;i++){
//          if(min>b[i])min=b[i];
//      }
        for (int i = 1; i < 5; i++) {
            if (max < b[i]) {
                max = b[i];
            }
            if (min > b[i]) {
                min = b[i];
            }
        }


        //System.out.println(max);
        //System.out.println(min);
        for (int i = 0; i < 5; i++) {
            System.out.print(b[i]+" ");
        }
        System.out.println();
        Arrays.sort(b);
        for (int i = 0; i < 5; i++) {
            System.out.print(b[i]+" ");
        }

    }
}
